#include "server.hpp"

int main()
{
    Buffer buf;
    std::string str = "hello world！！";

    for(int i = 1 ;i < 300;i++)
    {
        std::string in = str + std::to_string(i) + '\n';
        buf.WriteString(in); 
    }

    while(buf.GetReadableSpace() > 0)
    {
        std::string line = buf.GetLine();
        DEBUG_LOG("%s",line.c_str());
    }

    // std::cout << buf.GetReadPos() << std::endl; 
    // std::cout << buf.GetWritePos() << std::endl;

    // char* pos = buf.FindCRLF(); //找回车换行
    // std:: cout << "pos : " << pos << std::endl;

    // std::string readbuf = buf.ReadString(buf.GetReadableSpace());
    // std::cout << readbuf << std::endl;

    // std::cout << buf.GetReadableSpace() << std::endl;
    // std::cout << buf.GetTailAvailableSize()  + buf.GetHeadAvailableSize()<< std::endl;

    
    return 0;
}